<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: udd.h File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">udd.h File Reference</div>  </div>
</div>
<div class="contents">

<p>Common API for USB Device Drivers (UDD)  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="usb__protocol_8h_source.html">usb_protocol.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="udc__desc_8h_source.html">udc_desc.h</a>&quot;</code><br/>
</div>
<p><a href="udd_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structudd__setup__req__t.html">udd_setup_req_t</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structudd__ctrl__request__t.html">udd_ctrl_request_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Global variable to give and record information of the setup request management.  <a href="structudd__ctrl__request__t.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gaffd9b7cf165cd149868373fa12595d12">Udd_setup_is_in</a>()&#160;&#160;&#160;(USB_REQ_DIR_IN == (udd_g_ctrlreq.req.bmRequestType &amp; USB_REQ_DIR_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if the setup request <em>udd_g_ctrlreq</em> indicates IN data transfer.  <a href="group__udd__group.html#gaffd9b7cf165cd149868373fa12595d12"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gaf67b7c8de30fdc881b567385f2345926">Udd_setup_is_out</a>()&#160;&#160;&#160;(USB_REQ_DIR_OUT == (udd_g_ctrlreq.req.bmRequestType &amp; USB_REQ_DIR_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if the setup request <em>udd_g_ctrlreq</em> indicates OUT data transfer.  <a href="group__udd__group.html#gaf67b7c8de30fdc881b567385f2345926"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga85dc2b7b6c270e8dd8323fa4779a7ca2">Udd_setup_type</a>()&#160;&#160;&#160;(udd_g_ctrlreq.req.bmRequestType &amp; USB_REQ_TYPE_MASK)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the type of the SETUP request <em>udd_g_ctrlreq</em>.  <a href="group__udd__group.html#ga85dc2b7b6c270e8dd8323fa4779a7ca2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gac963bb7b8a965c2fec45a71c9faca6f5">Udd_setup_recipient</a>()&#160;&#160;&#160;(udd_g_ctrlreq.req.bmRequestType &amp; USB_REQ_RECIP_MASK)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the recipient of the SETUP request <em>udd_g_ctrlreq</em>.  <a href="group__udd__group.html#gac963bb7b8a965c2fec45a71c9faca6f5"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga6f25ea016c07bd48c3074f51d8ef8b01">udd_ep_id_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Endpoint identifier.  <a href="group__udd__group.html#ga6f25ea016c07bd48c3074f51d8ef8b01"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga7ab8d43f0761ecfb4d48770ac4ebb661">udd_callback_halt_cleared_t</a> )(void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">End of halt callback function type. Registered by routine udd_ep_wait_stall_clear() Callback called when endpoint stall is cleared.  <a href="group__udd__group.html#ga7ab8d43f0761ecfb4d48770ac4ebb661"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gad866ed9444482edcf92a28dce807e3d3">udd_callback_trans_t</a> )(<a class="el" href="group__udd__group.html#gac0f77f5a0e085af1242b48fd1054959a">udd_ep_status_t</a> status, iram_size_t nb_transfered)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">End of transfer callback function type. Registered by routine udd_ep_run() Callback called by USB interrupt after data transfer or abort (reset,...).  <a href="group__udd__group.html#gad866ed9444482edcf92a28dce807e3d3"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gac0f77f5a0e085af1242b48fd1054959a">udd_ep_status_t</a> { <a class="el" href="group__udd__group.html#ggac0f77f5a0e085af1242b48fd1054959aad52bb23180c67dc3d6a1d1dfedf74102">UDD_EP_TRANSFER_OK</a> =  0, 
<a class="el" href="group__udd__group.html#ggac0f77f5a0e085af1242b48fd1054959aa010443246cb439e4f6f52b13c9d6e29c">UDD_EP_TRANSFER_ABORT</a> =  1
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Endpoint transfer status Returned in parameters of callback register via udd_ep_run routine.  <a href="group__udd__group.html#gac0f77f5a0e085af1242b48fd1054959a">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga14096700b3ed8c5168615c5c5ee1c68d">COMPILER_PACK_SET</a> (1)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A USB Device SETUP request.  <a href="group__udd__group.html#ga14096700b3ed8c5168615c5c5ee1c68d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gabe317a1520896eaf568afab27dc71540">COMPILER_PACK_RESET</a> ()</td></tr>
<tr><td colspan="2"><div class="groupHeader">Management of bulk/interrupt/isochronous endpoints</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Buffer to store the data received on control endpoint (SETUP/OUT endpoint 0)</p>
<p>Used to avoid a RAM buffer overflow in case of the payload buffer is smaller than control endpoint size</p>
<p>The UDD manages the data transfer on endpoints:</p>
<ul>
<li>Start data tranfer on endpoint with USB Device DMA</li>
<li>Send a ZLP packet if requested</li>
<li>Call callback registered to signal end of transfer The transfer abort and stall feature are supported. </li>
</ul>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gaa4cac8c35ae056e26cf4ab5b426bbe09">udd_include_vbus_monitoring</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Authorizes the VBUS event.  <a href="group__udd__group.html#gaa4cac8c35ae056e26cf4ab5b426bbe09"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga9792d1899ae058e3984d6a622fe2ad42">udd_enable</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the USB Device mode.  <a href="group__udd__group.html#ga9792d1899ae058e3984d6a622fe2ad42"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gab283432057b934e9d73ac9282d9b0f11">udd_disable</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the USB Device mode.  <a href="group__udd__group.html#gab283432057b934e9d73ac9282d9b0f11"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga7a7c0d9236c922c2af33c6702565a99f">udd_attach</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attach device to the bus when possible.  <a href="group__udd__group.html#ga7a7c0d9236c922c2af33c6702565a99f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga03e59eaa264f1dbe5a52559311d0520e">udd_detach</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Detaches the device from the bus.  <a href="group__udd__group.html#ga03e59eaa264f1dbe5a52559311d0520e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga85f403ddb78776b1ba014dafd3ffec2c">udd_is_high_speed</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Test whether the USB Device Controller is running at high speed or not.  <a href="group__udd__group.html#ga85f403ddb78776b1ba014dafd3ffec2c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga05da762e0faf9d478e532de40afa71f6">udd_set_address</a> (uint8_t address)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the USB address of device.  <a href="group__udd__group.html#ga05da762e0faf9d478e532de40afa71f6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gaebd36638d482f6df00a8aff006ef2246">udd_getaddress</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the USB address of device.  <a href="group__udd__group.html#gaebd36638d482f6df00a8aff006ef2246"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga96dc248cc05e07ffe2cf21e4d7465320">udd_get_frame_number</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current start of frame number.  <a href="group__udd__group.html#ga96dc248cc05e07ffe2cf21e4d7465320"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga63047eec59b8e8798ca1d3366472d82b">udd_get_micro_frame_number</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current micro start of frame number.  <a href="group__udd__group.html#ga63047eec59b8e8798ca1d3366472d82b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga14ae6068206556d6ae8766b1baa2f686">udd_send_wake_up</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The USB driver sends a resume signal called Upstream Resume.  <a href="group__udd__group.html#ga14ae6068206556d6ae8766b1baa2f686"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga017ef5ea7626be258c24d345218976f9">udd_set_setup_payload</a> (uint8_t *payload, uint16_t payload_size)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Load setup payload.  <a href="group__udd__group.html#ga017ef5ea7626be258c24d345218976f9"></a><br/></td></tr>
<tr><td colspan="2"><div class="groupHeader">High speed test mode management</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>The following functions allow the device to jump to a specific test mode required in high speed mode. </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga43ba1e91e69f84c1481a659ff8eff143">udd_test_mode_j</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga2acd547bcd2b470ee4e1ce34087926a8">udd_test_mode_k</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gabec7e8b6464e92ca9c8f32c59113bcbb">udd_test_mode_se0_nak</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#gab72f68f8d1a50f7e734595a2ff626380">udd_test_mode_packet</a> (void)</td></tr>
<tr><td colspan="2"><div class="groupHeader">UDC callbacks to provide for UDD</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>The following callbacks are used by UDD. </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga58c2916d7984e0e5b2143cadf4af6080">udc_process_setup</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Decodes and manages a setup request.  <a href="group__udd__group.html#ga58c2916d7984e0e5b2143cadf4af6080"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga11a32ff7928ba06d3b59e95e0a2b7a92">udc_reset</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset the UDC.  <a href="group__udd__group.html#ga11a32ff7928ba06d3b59e95e0a2b7a92"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga4afae313045f44b5eb4c60957ab8ef4e">udc_sof_notify</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">To signal that a SOF is occured.  <a href="group__udd__group.html#ga4afae313045f44b5eb4c60957ab8ef4e"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structudd__ctrl__request__t.html">udd_ctrl_request_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udd__group.html#ga360872da67c7f8ecebe1238bbd4a536e">udd_g_ctrlreq</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Global variable to give and record information about setup request management.  <a href="group__udd__group.html#ga360872da67c7f8ecebe1238bbd4a536e"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Common API for USB Device Drivers (UDD) </p>
<p>Copyright (C) 2009 Atmel Corporation. All rights reserved. </p>
</div></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Mon Dec 19 2011 21:04:53 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
